// builder.h: Header for Builder abstract class
// Written by Victor Luna Freire - victorclf@live.com
// Copyright (c) Victor Luna Freire. All rights reserved.
// Sunday, October 25, 2009 10:15:17 PM

#ifndef BUILDER_H_28317238198237891
#define BUILDER_H_28317238198237891

#include "maze.h"

// Abstract class for a Builder that can be built step by step and return a renderable representation.
class Builder : public Maze {
protected:
	// Builds an empty maze with every cell isolated from each other.
	void clear_maze();

	// Carve a passage between two cells (cell position) and returns the removed wall position (true pos).
	Vec2i carve(const Vec2i &src_cpos, const Vec2i &dst_cpos);

public:
	// Construct Builder of width and height.
	Builder::Builder(int width, int height) : Maze(width, height) { clear_maze(); };
	
	// Start building.
	virtual void start_process() = 0;
	// Perform the next step in the build. Returns false if the build is over. Starts the building if it was not started before.
	virtual bool next_step() = 0;
	
	// Is the build done?
	virtual bool is_done() const = 0;

	
	
};

#endif // BUILDER_H_28317238198237891